<template>
  <div>
    <!-- 给标签绑定事件v-on -->
    <h1>{{count}}</h1>
    <button v-on:click="count=count+1">+1</button>
    <button @click='count=count+1'>+1</button>
    <button v-on:click="reduce">-1</button>
    <button @click="reduce">-1</button>
    <button v-on:click="add(5)">+5</button>
    <button @click="add(10)">+10</button>
  </div>
</template>

<script>
export default {
data (){
 return {
    count:0
 }
},
methods:{
  reduce(){
    // this.count=this.count-1
    this.count--
  },
  add(n){
    this.count+=n
  }
}
}
</script>

<style>

</style>